package cn.avalon.feign;

import cn.avalon.domain.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @description: 负载均衡
 * @author: Avalon
 * @date: 2022年09月17日 ： 23:17
 * @version: ver1.0
 * @email 709785494@qq.com
 */
@FeignClient(value = "user-service", fallbackFactory = UserFeignFallbackFactory.class) // 指定需要调用的服务的应用名称
@RequestMapping("/user")
public interface UserFeign {

    @GetMapping("/{id}")
    User findById(@PathVariable("id") Long id);
}
